﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XXF.ProjectTool;

namespace XXF.Api
{
    /// <summary>
    /// 返回列表类型
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class ListResult<T>
    {
        /// <summary>
        /// 返回列表
        /// </summary>
        public List<T> List { get; set; }
        /// <summary>
        /// 返回结果总数
        /// </summary>
        public int Total { get; set; }
        /// <summary>
        /// 获取列表集合
        /// </summary>
        /// <param name="list"></param>
        /// <param name="total"></param>
        public ListResult(List<T> list, int total)
        {
            if (list == null)
                List = new List<T>();
            else
                List = list;
            Total = total;
        }
    }

    /// <summary>
    /// 默认DictionaryResult类型 （非泛型版本）
    /// </summary>
    public class ListResult
    {
        /// <summary>
        /// 返回列表
        /// </summary>
        public List<DictionaryResult> List { get; set; }
        /// <summary>
        /// 返回结果总数
        /// </summary>
        public int Total { get; set; }
        /// <summary>
        /// 获取列表集合
        /// </summary>
        public ListResult(List<DictionaryResult> list, int total)
        {
            if (list == null)
                List = new List<DictionaryResult>();
            else
                List = list;
            Total = total;
        }
    }
}
